package com.pearl.jacksoncore.demo.feature;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * @author TD
 * @version 1.0
 * @date 2024/4/3
 */
public class FinalPerson {

    private final  String name;

    private final  int age;

    @JsonCreator
    public FinalPerson(@JsonProperty("name")String name, @JsonProperty("age") int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public int getAge() {
        return age;
    }

    @Override
    public String toString() {
        return "FinalPerson{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
